home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / mysql-test / t / sel000031.test < prev    next >
Encoding:
Text File  |  2003-01-21  |  471 b   |  21 lines  |  [TEXT/ttxt]

  1. # sel000031
  2. #
  3. # Versions
  4. # --------
  5. #   3.22
  6. #   3.23
  7. #
  8. # Description
  9. # -----------
  10. # test for a bug with elt() and order by
  11.  
  12. drop table if exists t1,t2;
  13. create table t1 (id int(10) not null unique);
  14. create table t2 (id int(10) not null primary key,
  15. val int(10) not null);
  16. insert into t1 values (1),(2),(4);
  17. insert into t2 values (1,1),(2,1),(3,1),(4,2);
  18.  
  19. select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
  20. drop table t1,t2;
  21.